Mathworks has a product called the MATLAB Builder NE for doing just this.
It will build a DLL for either .NET or COM, wrapping the MATLAB code. You can then execute the code on any machine which has the MATLAB runtime (free) installed on it.
From what I've seen, this really just creates a DLL with the proper overloads for every function in your code, and helps you convert from .NET types into MATLAB arrays. In the end, it is still calling native MATLAB code and running it on the MATLAB runtime, so it is something that could be self-implemented as well (although it would take some probably significant effort).