Is there an example I can follow for creating an IMB barcode for US Mail?
It is a simple addition of the barcode object (OneCode in version of Connect prior to version 2019.2, if not USPS IMb).
The content has to be provided in its entirety in the data (field). You can read about it in our document here and here.
As how to build the string, unfortunately, that is outside of the scope of this forum (unless some users wishes to share their knowledge about it), but you can get more detail information here.