Hello Phil,
Tcode :- VBN1 where we create the free goods.
Maintain material A at the material field and the material B at the Additional Free Good field.
Before maintaining it , you need to set up the Free Good determination to your Sales Document Type.
Please go through the below link to know more about Free Goods
http://wiki.scn.sap.com/wiki/display/ERPLO/Free+Goods+Determination
Thank you for your time.
Siva.