it should be quite easy. probably the most difficult thing is setting up the compiler and linker (i always hate that! ).

in the manual there is an example for a dllfunction which draws a triangle. drawing a line would be almost the same. you will need two vertices only and i think instead of trianglefan you have to use the linelist mode for drawprimitiveup.