I think you should study the reverse engineering of TDS DLL files.
The main file that creates the code is HedgehogDevelopment.SitecoreProject.VSIP2015.dll in D: \ Program Files (x86) \ Hedgehog Development \ Team Development for Sitecore (VS2015).
The master record for code generation should be in the Manager class, however I am not sure about that.
source share