Visual Studio Documentation Page o' the Day: How to Use Wizards with Project Templates
Visual Studio provides the IWizard interface that, when implemented, enables you to run custom code when a user creates a project from a template.
For details, see https://msdn.microsoft.com/en-us/library/ms185301.aspx.