There's a section about this already in the .NET Framework SDK. Read Generating and Compiling Source Code Dynamically in Multiple Languages[^]. It would've also been better if you tried searching CodeProject first. There's thousands of articles about many subjects, and researching is part of "Research and Development". The following search yields many decent articles: http://www.codeproject.com/info/search.asp?cats=3&cats=5&searchkw=CodeDom[^]
Microsoft MVP, Visual C# My Articles