Hmm. This is interesting, because most of the time, icons are stored as resources rather than straight .ico files.
I can't answer this, but hopefully I can point you in the right direction.
First of all, you will need to poke around in the registry. Say for example you want to find the icon associated with a .txt file...
In the registry, there will be a key under HKEY_CLASSES_ROOT called ".txt". This will have a default value associated with it - this is "txtfile". Now this is actually the name of another registry key, so go to HKEY_CLASSES_ROOT\txtfile.
This will have a subkey called DefaultIcon, and this will give you the icon you're looking for.
Now the above should work for any registered file type. (eg. .vbp files have a ".vbp" key, which points you to another key called VisualBasic.Project, which has a subkey called DefaultIcon, etc. etc.
Now this is where my experience ends. I can tell you that the entry in this DefaultIcon is giving you resource information. For example, the VisualBasic.DefaultIcon key says something like "somedrive/somepath/vb6.exe,16". This tells you that the icon is the 16th icon in this exe.
You can actually view these icons if you want. Right-click a shortcut, click Change Icon, then Browse and select the vb6.exe (or what ever .exe or .dll or whatever you want) and it will display all the icons stored in that file.
To extract the icon itself you will need to load the library and pull the resource and for this you will need a few API calls. Like I say, I have not gone this far before, so I will leave that bit up to you!
Good luck!