In order to balance out the trade defict it is necessary that the US firm makes the $5 million back in either through selling US goods internally or externally via exports. If the firm is able to make the $5 million back, the firm balances the trade budget. If it makes more than $5 million it creates a surplus which will help the trade balance or create a surplus. If the firm is unable to make $5 millon back it creates a defict which then contributes to a trade defict.
The exhange of foreign commodites with/for US services benefits the US economy by allowing the purchase of cheap foriegn services and goods to which can be easily turned around internally as well as the export of speciality items to service a market niche both interally and externally.