You ask how to compile a mex file directly on the Matlab command line.
An alternative would be to compile the mex file from Visual Studio. You might be interested in the following procedure.
Compiling mex files with Visual Studio
which was tested with Visual Studio 2010, Matlab 2010a, and for the 64-bit Intel target machine.
There is also a Visual Studio 2010 project that you can download and modify using your own configuration settings, if necessary.
source share