First and foremost, this method requires Autohotkey_H. Second, the most important thing to be sure of is to use the right dll. If you are using AHK 32 Unicode, then use that version of the dll; the dll type should match the executable.
Although when you look at Autohotkey_H this seems like something you can obviously do, I haven't seen any specific examples on how to accomplish this; on the contrary, I have only seen posts claiming that this is impossible or extremely difficult to script.
So here's a very basic example of how to accomplish this.
Currently, the way I like to implement this is to create a function that dynamically creates the code for the label, loads that up into a variable, and then passed that variable into ahktextdll.
I like using the hotkey label simply as a wrapper back to a function (or label) in Autohotkey.exe so that I can keep the brunt of my code in my main script. This is a cleaner approach, IMHO, and it leaves less room for error.
Note: the dll thread is not multi-thread safe. For those of you who need to ensure multi-threading safety, use the CriticalObject function