Manuel shows a great way how to generate a state machine from the build-in class diagram in VS 2010 RTM using T4 Templates.

image

I highly recommend reading his article here and get the UML Profile for State Diagrams for VS2010 and the T4 template from his blog.

Manuel’s Article: http://halllo-welt.spaces.live.com/blog/cns!E6C5570276BDBE2B!562.entry