You'll need to use the Matlab add in for visual studio. Here is an example:
http://www.codeproject.com/KB/macros...ab_add_in.aspx

And here is the Mathworks' instructions for setting up the Matlab add-in.
http://www.mathworks.com/support/sol...lution=1-18L04