Concerning the MATLAB "features", check this blog entry by Loren:
http://blogs.mathworks.com/loren/2011/02/03/creating-c-shared-libraries-and-dlls/
It shows a pretty complete example of how to create a shared library and how to use it.
Quoting example code from that link, to initialize the MCR and the generated library you'll have to call:
// Initialize the MATLAB Compiler Runtime global state
if (!mclInitializeApplication(NULL,0))
{
std::cerr << "Could not initialize the application properly."
<< std::endl;
return -1;
}
// Initialize the Vigenere library
if( !libvigenereInitialize() )
{
std::cerr << "Could not initialize the library properly."
<< std::endl;
return -1;
}
Where you'll obviously have to replace libvigenere
by your library's name.
Now you can call your generated matlab functions just as you would call any C function.
And finally, shut down everything:
// Shut down the library and the application global state.
libvigenereTerminate();
mclTerminateApplication();
Concering the connection to python, there are multiple ways, all described e.g. in this question:
Calling C/C++ from python?