Just write it out to file and call csc.exe using the Process class. You may have to wrap the code snippet in a class or namespace depending on what is considered a "code snippet", but it should work.
Jon Skeet's Snippy program does what you're wanting to do. Check it out and study it's code. It might be exactly what you're looking for.
David Morton -
http://blog.davemorton.net/