The CodeDOM rocks!
I've been doing a lot of work lately with the CodeDOM namespace, and I've got to applaude Microsoft for this one. If you need to generate langugage agnostic code, this is most definatly the way to do it.
I'm in the middle of creating a proxy generator that generates a client-side proxy for a web service (sort of like wsdl.exe does, only the proxy is spicific to our ESB architecture), and I needed to create either Visual Basic or C# source files; CodeDOM to the rescue.
The code I currently have in place is pretty complicated, but I'm going to scale it down and post a bit of it in my codesnippet section that way its a bit more consumable. I just had to applaud MS on this one; way to go guys!
[Listening to: My dog growl as she chases her tennis ball around]