Files involved

Virtually all relevant information is contained in the directory C:\TwinCAT\3.x\Components\Base\CppTemplate:

Files involved 1:

The TwinCAT C++ Project Wizard calls the TwinCAT Module Class Wizard if a Driver Project is to be created.

Directory: Driver and Class

The respective project types are defined in the Driver (for TwinCAT C++ Project Wizard) and Class directory (for the TwinCAT Module Class Wizard), each project type encompassing 3 files:

Files involved 2:

The .vsdir file provides information that is used when the respective assistant wizard is started. This is essentially a name, a brief description and a file name of the type .vsz containing details for this project type.
The general description in the MSDN can be found here: https://msdn.microsoft.com/de-de/library/Aa291929%28v=VS.71%29.aspx.

The .vsz file referenced in the .vsdir file provides information that is needed by the wizard.
The most important information here is the wizard that is to be started and a list of parameters.

Both wizards have a .xml file as a parameter that describes the transformations of, for example, source files from the template to the specific project. These are located together with the templates for the source code, etc. in the Templates directory.
If a driver is to be created, the TwinCAT C++ Project Wizard starts the TwinCAT Module Class Wizard via the TriggerAddModule parameter.

The general description in the MSDN can be found here: https://msdn.microsoft.com/de-de/library/Aa291929%28v=VS.71%29.aspx.

The .ico file merely provides an icon.

Directory: Templates

Both the templates for the source code and the .xml file named in the .vsz file for the TwinCAT Module Class Wizard are located in corresponding subdirectories in the Templates directory.

This .xml file describes the procedure for getting from the template to a real project.