If you are not opposed to Inkscape, it will by default render gears (under the extension/render menu), and has a TikZ export extension that you can install (from here) to export TikZ code. It won't be as flexible as Caramdir's answer, but you can specify number of teeth, pitch and angle. It produces the following:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[y=0.80pt,x=0.80pt,yscale=-1, inner sep=0pt, outer sep=0pt]
\begin{scope}[shift={(375.0,532.3622047)}]
\path[draw=black] (57.0460,-5.3460) -- (59.5620,-5.5820) -- (63.4660,-4.9950) --
(69.9930,-2.2120) -- (69.9930,2.2120) -- (63.4660,4.9950) -- (59.5620,5.5820)
-- (57.0460,5.3460) -- (55.9060,12.5440) -- (58.3710,13.0970) --
(61.9030,14.8620) -- (67.2510,19.5260) -- (65.8840,23.7320) --
(58.8160,24.3620) -- (54.9220,23.7140) -- (52.6020,22.7130) --
(49.2930,29.2060) -- (51.4670,30.4940) -- (54.2810,33.2630) --
(57.9260,39.3520) -- (55.3260,42.9300) -- (48.4090,41.3450) --
(44.9050,39.5250) -- (43.0090,37.8560) -- (37.8560,43.0090) --
(39.5250,44.9050) -- (41.3450,48.4090) -- (42.9300,55.3260) --
(39.3520,57.9260) -- (33.2630,54.2810) -- (30.4940,51.4670) --
(29.2060,49.2930) -- (22.7130,52.6020) -- (23.7140,54.9220) --
(24.3620,58.8160) -- (23.7320,65.8840) -- (19.5260,67.2510) --
(14.8620,61.9030) -- (13.0970,58.3710) -- (12.5440,55.9060) --
(5.3460,57.0460) -- (5.5820,59.5620) -- (4.9950,63.4660) -- (2.2120,69.9930)
-- (-2.2120,69.9930) -- (-4.9950,63.4660) -- (-5.5820,59.5620) --
(-5.3460,57.0460) -- (-12.5440,55.9060) -- (-13.0970,58.3710) --
(-14.8620,61.9030) -- (-19.5260,67.2510) -- (-23.7320,65.8840) --
(-24.3620,58.8160) -- (-23.7140,54.9220) -- (-22.7130,52.6020) --
(-29.2060,49.2930) -- (-30.4940,51.4670) -- (-33.2630,54.2810) --
(-39.3520,57.9260) -- (-42.9300,55.3260) -- (-41.3450,48.4090) --
(-39.5250,44.9050) -- (-37.8560,43.0090) -- (-43.0090,37.8560) --
(-44.9050,39.5250) -- (-48.4090,41.3450) -- (-55.3260,42.9300) --
(-57.9260,39.3520) -- (-54.2810,33.2630) -- (-51.4670,30.4940) --
(-49.2930,29.2060) -- (-52.6020,22.7130) -- (-54.9220,23.7140) --
(-58.8160,24.3620) -- (-65.8840,23.7320) -- (-67.2510,19.5260) --
(-61.9030,14.8620) -- (-58.3710,13.0970) -- (-55.9060,12.5440) --
(-57.0460,5.3460) -- (-59.5620,5.5820) -- (-63.4660,4.9950) --
(-69.9930,2.2120) -- (-69.9930,-2.2120) -- (-63.4660,-4.9950) --
(-59.5620,-5.5820) -- (-57.0460,-5.3460) -- (-55.9060,-12.5440) --
(-58.3710,-13.0970) -- (-61.9030,-14.8620) -- (-67.2510,-19.5260) --
(-65.8840,-23.7320) -- (-58.8160,-24.3620) -- (-54.9220,-23.7140) --
(-52.6020,-22.7130) -- (-49.2930,-29.2060) -- (-51.4670,-30.4940) --
(-54.2810,-33.2630) -- (-57.9260,-39.3520) -- (-55.3260,-42.9300) --
(-48.4090,-41.3450) -- (-44.9050,-39.5250) -- (-43.0090,-37.8560) --
(-37.8560,-43.0090) -- (-39.5250,-44.9050) -- (-41.3450,-48.4090) --
(-42.9300,-55.3260) -- (-39.3520,-57.9260) -- (-33.2630,-54.2810) --
(-30.4940,-51.4670) -- (-29.2060,-49.2930) -- (-22.7130,-52.6020) --
(-23.7140,-54.9220) -- (-24.3620,-58.8160) -- (-23.7320,-65.8840) --
(-19.5260,-67.2510) -- (-14.8620,-61.9030) -- (-13.0970,-58.3710) --
(-12.5440,-55.9060) -- (-5.3460,-57.0460) -- (-5.5820,-59.5620) --
(-4.9950,-63.4660) -- (-2.2120,-69.9930) -- (2.2120,-69.9930) --
(4.9950,-63.4660) -- (5.5820,-59.5620) -- (5.3460,-57.0460) --
(12.5440,-55.9060) -- (13.0970,-58.3710) -- (14.8620,-61.9030) --
(19.5260,-67.2510) -- (23.7320,-65.8840) -- (24.3620,-58.8160) --
(23.7140,-54.9220) -- (22.7130,-52.6020) -- (29.2060,-49.2930) --
(30.4940,-51.4670) -- (33.2630,-54.2810) -- (39.3520,-57.9260) --
(42.9300,-55.3260) -- (41.3450,-48.4090) -- (39.5250,-44.9050) --
(37.8560,-43.0090) -- (43.0090,-37.8560) -- (44.9050,-39.5250) --
(48.4090,-41.3450) -- (55.3260,-42.9300) -- (57.9260,-39.3520) --
(54.2810,-33.2630) -- (51.4670,-30.4940) -- (49.2930,-29.2060) --
(52.6020,-22.7130) -- (54.9220,-23.7140) -- (58.8160,-24.3620) --
(65.8840,-23.7320) -- (67.2510,-19.5260) -- (61.9030,-14.8620) --
(58.3710,-13.0970) -- (55.9060,-12.5440) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}

decorations
.