Tthe "text" folder can actually be created almost anywhere on your machine.
First, you must build your code into the desired DLL or EXE
Next, create a "protk.dat" file, which you can "register" into Creo.
That "protk.dat" file points Creo to the location of the "text" directory that you would like to load with your application.
You should be able to mimic the setup of the examples. For Pro/TOOLKIT, check out the "protk_install_example" that is located in the "protoolkit" subfolder of your installation.
Here are some PTC support docs that may also help: