Think about what a loan is in terms of purchasing power. You give a bank your signature on a loan contract and they give you something that will allow you to buy real stuff (houses, cars, whatever). You enjoy this real stuff for some time. Then at the end you have to give the bank something that will allow them to buy real stuff, only more of it. I'm calling it "something" instead of "dollars" for a reason I will explain below.
In the foreign exchange case, the US gives other countries pieces of paper, which are essentially IOUs. They give the US either real stuff, which is then enjoyed, or they give the US their currency, which is immediately spent on real stuff. The US doesn't hoard their currency. Time passes and at the end they give back the IOU's in exchange for some real stuff. Only instead of giving back more real stuff than was originally given, the US gives back less (because of inflation).
I called dollars "something" in the loan example and "IOUs" in the macro example because dollars take on a different role in each case. In the loan, the dollars represent real purchases that are made immediately. In the macro example, the dollars take the place of the loan contract. They don't buy any real stuff until the end of the transaction.
You can think of it another way by ignoring the dollars. Foreigners give the US electronics and clothes and stuff in exchange for nothing. After a while the US gives them back food and machines or whatever, only what the US gives back is worth less than the electronics and clothes it was given. That's a zero interest (or negative interest) loan.
By the way, it's not just foreigners. Whoever holds currency has given up something valuable (time, materials, land, etc.) in exchange for paper. As long as that paper is under your mattress, you are not consuming and the paper is becoming worth less than it was. You've made a negative interest loan.