The source code for the USB receipt printer ESC/POS library is up on github. See the picture gallery for a printer test showing various text sizes, effects, and a QR code printed in graphics mode. My printer does not have built-in bar code functions (the Adafruit Mini thermal printer does) so all bar codes must be printed as graphics. In addition, the graphics commands for the Adafruint printer do not work on my printer so I added a new function that uses an older graphics mode.
I first thought the next one was a real typewriter with USB but it is only a keyboard with two large scroll wheels. I am not sure what the lever does. Maybe send carriage return and linefeed. It is wireless so not useful for this project.