This article does a great job of identifying the costs of the US effort in Afghanistan. This does not count the Canadian dollars, the British pounds, the Euros, but is still instructive.
I do hate the "well, we could have spent it on x in the US." This is true of lots of stuff, including the Bush tax cuts and deals made with the drug companies. I think we can figure out that the magnitudes here are quite significant.
Of course, the real question is costs down the road--as the costs already paid are just that. Can't change them now without a time machine.