Just drag the folder to the right side of the Dock. (Just don't drop it in the Trash.) To see the contents, just right click the folder or left click and hold until the contents pop up.
Edit: And make sure you're not dragging the folders in the Sidebar within Finder...dragging those will just remove them from the Sidebar. You have to actually navigate to the folder in the main Finder window and then drag that.