If you really want to write a compiler, you should get a book about compiler design. The basic ideas are understandable, although compiling a language as complex as
VB can be hard.
If you want to be able to compiler and execute code in your applications, you might want to look at VSA. See this example:
http://www.vb-helper.com/howto_net_use_vsa.html