One way to reorder them is to use a minimise-to-tray app to minimise the visible windows to the tray, then restore them in the (reverse) order you wish; the taskbar buttons will be re-created and you will have the order you want.
The first program that I saw that was specifically designed to let you control the order of taskbar buttons was PCMag’s ButtonBoogie. It used to be free, so maybe you can find a copy from back then. Otherwise, there’s Taskbar Button Manager, Taskbar Commander, Taskix, Taskbar Sorter, and Taskbar Shuffle. Most are/should be compatible with Vista and 7, except for Taskbar Shuffle which specifically says it won’t work in 7.
Finally, to reorder the notification area (ie tray) icons, there is Shell Tray Info.
(And for the record, the taskbar-button-reordering function in Windows 7 is incomplete; it only lets you move button groups, not individual buttons. For example, you cannot move individual Explorer or Notepad buttons, the whole bunch moves together.)