By default, if you try pinning folders to the taskbar on Windows 7 or the current version of Windows 8 the folder will be put into the context menu of the taskbar's explorer icon.
To prevent this and stick a folder directly to the taskbar, you need to create a shortcut of the folder you want to pin (right-click and Create shortcut). Afterwards right-click the shortcut and select Properties. On the Target line you will see the path of the object that the shortcut is pointing to - put explorer in front of that path and separate them with a space character (e.g. explorer "C:\New_Folder"). Now click OK and drag the shortcut to the taskbar.