As an example, I decided to use 3d printing to repair my bike light. More exactly, it was my bike light's handlebar mount that needed fixing. It's a NiteRider MiNewt 600 Cordless Rechargable Headlight and I broke the section that connects the light to the handlebar clip. At TechShop, I was able to successfully design and print a repair part.
Audodesk 123D, or other CAD software.
3D Printer (or printing service). I used Makerbot, Type A Machines, and Objet.
Step 1: CAD your replacement part
It isn't necessary to replicate all of the part's feature's exactly. Identify which dimensions are critical for attaching the light and then finish it off however you like. It's important to remember that your final part will probably be made out of a material that is less strong than the original. Add extra support and keep in mind the orientation you will end up printing in. If you are using a Makerbot or other FDM (filament-type) printer, the material will be much weaker in some directions than others. One tip for getting a good finish is to add small fillets (~0.05" or so) to all of your part's edges since most printers aren't effective at creating sharp corners.
I exported the shape as an STL file to bring to the 3d print software.