How to program USB host shield?

It is mysterious if it is unknown. Now you have started calling it a 3D printer you elevated it to the level of “vague machine”. Still not enough. Learn how to ask questions smartly. Nobody is going to help if you don’t provide concrete details of at least brand or model names, or links to it’s documentation. That’s not because they don’t want to, that because they can’t! (pull the answer out of their hat)

READ THIS: https://forum.sparkfun.com/viewtopic.php?f=14&t=27089

As it seems you would need to program some sort of driver on the Arduino to drive the USB host shield for this printer I won’t be able to help. That level is going to be way over my head.