In VB (I know this is a C forum)

Assume you wrote all of your commands to a text file, just send the file to the printer using the Escape api
Code:
Private Declare Function Escape Lib "gdi32" (ByVal hdc As Long, _
ByVal nEscape As Long, ByVal nCount As Long, ByVal lpInData _ 
As String, lpOutData As Any) As Long
Const PASSTHRU = 19

Sub printit()
  open "myfile.txt" for input as #1
    tmp = Input(LOF(1),1)
    Escape Printer.hDC,PASSTHRU,Len(tmp), tmp, 0&
    close #1
    Printer.EndDoc   ' if you need it.
End Sub
This is the same as direct printing - bypassing windows formatting & graphics.