after 5500 rpm u are in fact losing hp, but when u take into consideration that when you shift at 5500 rpm you will drop way below 4000rpm which is much lower in the powerband than when u shift at 6000 or 6200 which will drop you right around 4000 or a little higher. You dont want to shift at peak power, that does not make sense, especially when you take into account the gearing.
As WS says, the trick is to shift at the point in the powerband where the power is the same as when you start on next gear. So I usually shift when reaching 6000 or a little more (my rev limiter is at around 6500).
If anyone's keenly interested in finding out exactly when to shift, I have code for a program that tells you. You give it your gear ratios and some data points from a dyno graph and it spits out optimal shift points for each gear.
Like WS said though, sometimes it makes sense to hang on to a gear past the point of diminishing returns in order to end up in a favorable spot in the next gear. This is especially true in cars with long gears.