When you pin something to the taskbar, as far as I've been able to determine, the following happens (any Windows 7 Ent machine I've used)
1. A brand new shortcut to the final target is created at %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar. <-- note: changing the icon here won't do jack. See #2.
In the case of a dragging an exe or other non-shortcut file type, the default icon is used for the new automatically created shortcut. If, however, a shortcut is dragged to the taskbar, the brand new shortcut will have it's icon set to the icon that the original dragged shortcut was set to.
2. The target property of the new shortcut created in the folder above is merged into the binary value located at registry location HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband\Favorites. The rest of the shortcut, including it's icon target is merged into the value FavoritesResolve.
It appears that the Explorer (or Internet Explorer? the integration is a bit confusing and inconsistent) uses these registry keys to constitute the taskbar.
If you want a custom icon for the taskbar button, create a shortcut on your desktop to the target, set the icon on the shortcut to what you want, then drag that shortcut to the taskbar. Then delete the shortcut from the desktop.