Using C++ classes in TwinCAT C++ module

When adding (non-TwinCAT) C++ classes using the Visual Studio context menu Add->Class..., the compiler/linker reports:

Error 4 error C1010: unexpected end of file while looking for precompiled 
header. Did you forget to add '#include ""' to your source? 

Insert the following lines at the start of your generated class file:

#include "TcPch.h"
#pragma hdrstop