So, to be the realist, here is what we know:
The original iPhone has been able to upgrade to even the latest iPhone OS, free of charge. (However, some features are not present, such as MMS and video recording.)
The iPhone 3G has the same basic 'processing' hardware as the original iPhone. It, also, has been able to upgrade to the latest iPhone OS, free of charge. (However, some features are not present, such as video recording.)
The iPhone 3GS has upgraded 'processing' hardware. It has been able to upgrade to the latest iPhone OS, free of charge, with all features.
So, based on past precedent, Apple has allowed all software upgrades at no cost to all iPhone users.
While this makes it likely that Apple will offer iPhone OS 4 free to all prior iPhone OS users, it is not a guarantee. Apple has been known to make new features available only to new hardware in the past. Although in this case, it would seem extremely strange to lock out iPhone 3GS users. I could see locking out original and 3G users based on processor power, (even if they could run it just fine, I could see Apple using that as an excuse,) but not 3GS.
Also, at this point, nobody has any clue what iPhone OS 4 entails (well, nobody that can publicly say, anyway.) So, for all we know, it could make older hardware run faster. (After all, each successive Mac OS X release from 10.0 through 10.4 ran faster than the preceding on the same hardware.) And, obviously, we also have no idea what possible hardware updates may be in store.