This time, we're going to create several separate shapes, Combine them together and save it off as a custom shape. This shape would be very difficult to create in any other way (aside from using Illustrator) so it is a perfect technique to learn in Photoshop.
Step 1: Create a new 500 x 500 canvas. Be sure your rulers are showing (Ctrl/Cmd + R). Also turn on Snap View > Snap). Now drag two guides out and position them at the halfway points both vertically and horizontally.
Step 2: Select the Polygon shape tool. Be sure the Shape Layer option is selected in the option bar. Also, set the number of sides to 6 in the options bar. Now draw a small rectangle and position it at the top of the canvas with a the vertical guide going straight through the center.
Step 3: Not hit Ctrl/Cmd + T to bring up the Free Transform bounding box. Drag the center point of the bounding box down to the center of the canvas where the two guides intersect. However, do not accept the transformation yet.
Step 4: Now position your cursor slightly outside the bounding box and notice the rotating arrow cursor that appears. Rotate your polygon around to the right while holding the shift key to constrain the rotation. Alternative, you can type 30 into the options bar for the angle setting. Hit enter to accept the settings.
Step 5: Now the cool part. We're going to let Photoshop do the rest of the work for us. Press Shift + Ctrl/Cmd + Alt/Option + T 11 times and notice how Photoshop creates a duplicate of the polygon while rotating it 30 degrees each time. Pretty cool huh?
Step 6: Now, select the ellipse shape tool. First be sure the "Add To Shape Area" button is selected in the top options bar. Then, Position your cursor in the center of the canvas. Hold down the Alt/Option + Shift keys and drag a circle out from the center.
Step 7: Now select the Subtract from Shape Area button in the same place as the button in step 6 and drag another circle out from the center to produce a cutout shape within the gear.
Step 8: Lastly, convert this to a custom shape by choosing Edit > Define Custom Shape. Now your shape is there to use whenever you want it in your Custom Shapes palette.
You can even apply layer styles to it as well. Below is a nice chrome style as well as another idea for creating custom shapes. You're not limited to just a gear. You could just as easily use this technique to create a flower shape too.