I've seen a couple .net applications that allow you to select a C# .cs source file and the program itself will compile this code and run it.
How is this done?
MSDN has a great series of articles explaining this...
My guess is by explicitly calling the csc.exe compiler. Keep in mind that this and any dependencies would have to be included with your deployment.
You can take a look at CS-Script which interprets C# files. Its free but not open sources though...