Hallo Boogeyman I had the sme problem too.
when creating the Device variable you need to use the whole name means:
microsoft.direk-x.direkt3d ... .device device = new microsoft. ... device();
or something similar. in the code to the article is alse one using statement missing it is the same namespace as the divice.
I have found a programm that converts the terragen files into .raw heightmaps.