When switching between open Apps in OS X, you might generally use Command-Tab; however, you can do similar switching, and far more, directly in the Dock. Even though the Dock is intended to be managed primarily with your mouse, Apple supports accessing it via the keyboard. The default action for this is to press Control-F3, but since some of its features are quite similar to Command-Tab, I recommend changing it to Option-Tab or something similar.
To do this, go to the Keyboard system preferences and then to the Keyboard section in the Shortcuts tab. Then click the Control-F3 shortcut next to “Move focus to the Dock” and give it a hotkey like Option-Tab (you cannot use Command-Tab). You can now use any of the following options for managing items the Dock:
Selecting and Opening Items
Use the left and right arrow keys (or Tab and Shift-Tab) to select the different items on the Dock, and then press Enter or the Space Bar to open them. You can also jump to an item by typing the first few letters of its name. One option here is to reveal the selected item in the Finder, by holding the Option key and pressing Enter. If you hold the Option key when pressing the Space bar, then the current application will be hidden when the new one is brought to the front.
Press the Up arrow key on a highlighted item to open its contextual menu, and then you can navigate the menu using the arrow keys, and then Enter or Space to select an item (this will not work on Stacks). Pressing the down arrow with no items in the menu selected will close the menu.
Note that you can also hold modifier keys before pressing the Up arrow, to reveal additional contextual options that might be available. For instance, doing so on the Finder will reveal the Relaunch option in its menu.
This may be a fun approach for some to try. Use arrows to select an item you want to move, and then hold the Option key. Now if you tap the right or left arrows, you will swap its place with the item to the left or right of it.
After using Tab or the arrow keys to select an item in the Dock, you can press Command-Q to quit it. Even if the program is in the background, it will quit without being brought to the forefront, unless it has unsaved changes, or otherwise requires your attention when quitting.
Adding and Removing Items
Removing items from the Dock using the keyboard will require you use the up arrow to access the item’s contextual menu and select the option to remove the item. However, to add items, you can make use of a hidden menu item in the Finder. Select your desired item, and then add it by pressing Shift-Control-Command-T. You can then use Control-F3 to change focus to the dock, and use the Option and arrow key combinations to move the item to the location of your choosing.
Hiding and Showing the Dock
A final option is to quickly hide and show the Dock, by pressing Option-Command-D. Note that when hidden, you can still access it by pressing Control-F3, or whatever custom hotkey you have assigned.