The problem with this process is that it is too easy to remove an app or folder by mistake. Once gone, there is no undo and if you don't know where the app or folder is located, it can be very had to get it back onto the Dock.
Mountain Lion tweaks the process just a bit. Now, to remove an app or folder from the Dock you need to drag it up about two inches. That is far enough that you aren't likely to do it unintentionally.
To removed an item from the Dock, drag it up until you see the small poof of smoke at the cursor (about 2 inches.) and let go of the mouse button. The Dock item will disappear into a poof of smoke.
As a reminder, the Dock shows the icons of all the open apps on your Mac and it also keeps the icons of some closed apps as an easy way to open them later. If you want to make an app stay on the Dock even when the app is closed, right-click on the app icon on the Dock and choose Options / Keep in Dock from the pop up menu.