Very basically you usually have a motor driving a gear wheel that in turn drives a dog clutch. The clutch can be moved to engage the dogs in either the anchor windlass drive or the warping end for rope handling.
When handling an anchor you pay in or out on the motor and then lock the cable in the desired position with a large friction brake, usually operated by hydraulics with a manual back up.
Have a look at these links:
http://www.jgwindlass.com/en-product12.htm http://www.rolls-royce.com/marine/pr.../anchoring.jsp http://www.rolls-royce.com/marine/do.../mer2_fact.pdf http://www.rolls-royce.com/marine/do.../mer1_fact.pdf