Visualization and Modeling Feature Pack with T4 Code Generation
This pack is available to all MSDN subscribers and among a host of other great features, adds T4-based code generation to our UML static class diagrams.
This add-in works with the C# profile that we shipped with Visual Studio to generate code.
It's a great example of how you can rather easily build a profile yourself to add yet more metadata to your UML model and enrich the code generation further.
You can find all the detail on editing and customizing the templates here: https://msdn.microsoft.com/library/ff657795.aspx