Unfortunately because of updates to Facebook this no longer works.
The easiest way is to do this through Google Chrome – if you don’t have it you can download it here.
Firstly, open Chrome, and go to www.facebook.com.
Secondly, go to settings (wrench) > tools > create application shortcuts.
You will then be given the option of a desktop, start menu and taskbar shortcut.

Now you have www.facebook.com pinned to your taskbar we need to change it to the url of the chat.
Open the chat at the bottom of the screen and click options and then pop out chat.
Now when this window is open copy the url, it should be http://www.facebook.com/presence/popout.php .
Next, navigate your way to - C:\Users\<username>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

Then find the Facebook icon, right click > shortcut then edit the target field, where it says –
“app=http://www.facebook.com/ “ change it to app=http://www.facebook.com/presence/popout.phpWhen you click on the Facebook icon on your taskbar it will take you straight to Facebook chat providing your logged in.