How Can I Send Text (and Not a Text File) to My Printer on OS X?
lp is able to read data from standard input, see man lp:


  lp  submits  files for printing or alters a pending job. Use a filename of "-" to force printing from the standard input.


So if you followed the advice given in the referenced question to install a "raw" printer you should be able to run

echo "whatever text you want to print" | lp -d Generic_usbtb -