I have notice that my iPhone running v2.0 will remember the volume for headphones and speakers independantly. For example, if you have headphones connected and set the volume to 50%, then remove them and set the volume to 100%, when you reattach the headphones the volume returns to 50% and vice versa. This also works on an iPhone 1st generation running v2.0. I do not know if this was a feature in v1.0, however.
[robg adds: This works in both phone mode and iPod mode; the onscreen display when setting the ringer volume level even tells you that you're setting the headphone ringer level when you've got headphones plugged in.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080805082400259