I recently created a very nice UML Class diagram inside Visual Studio 2010 (b2). The tools worked like a charm and I was able to model a rather complex domain within minutes.
We now have a topic in the documention about how to do this programmatically:
How to: Export UML Diagrams to Image Files