(Note: all of this applies to VS2013. Might be different with other versions.)
First, use $(TargetDir)
to find the file in your output path.
Ex: <#@ assembly name="$(TargetDir)MyDLL.dll" #>
Second, it seems that the template generator runs before references are copied to the output folder. So if you haven't successfully built at all yet, or haven't built at least once with the new reference added to the project, then the .dll will not be there.
And in fact it will never be there till you do successfully build, and if you're getting an error from the template generator that the reference can't be found, you'll never successfully build, and you're stuck.
The way to get out of this situation is to either exclude the template temporarily, get your project to build, (which will copy references), and then add it back; or else manually copy the .dlls yourself to the directory that it's complaining about. Once things are building, they should stay building.
(Since the template generator runs before references are copied, I suspect there would be a similar issue involving new code. If you add new code to a library, and make use of it in your template before building, you would get stuck with the template not being aware of the new code, which makes it throw an error, which makes your build not succeed, so it doesn't get the new version, and you're stuck again.)
(You also should end up in this situation whenever you clean or rebuild your project, but I don't seem to have that happen very often, so there may be more to this than I realize.)