With Mountain Lion's Finder sidebar, you have to right-click an entry and choose Remove from Sidebar from the contextual menu.
It might appear that this is now the only way of removing icons from Mountain Lion's dock, too. But I discovered that if you drag an icon out of the dock, then hold it anywhere for a second, the first frame of the "poof" animation appears next to the cursor. When you release the mouse button, the icon will disappear.
This is a nice touch to prevent users from accidentally removing icons from the dock.
[kirkmc adds: This irked me when I finally installed the Mountain Lion GM on my main Mac. I didn't come across this drag-and-hold-a-second thing, and it's good to know. The Finder sidebar bit is annoying, and maybe the same trick will eventually work there.]

