You'll need to take apart the housing (the large center part with the wires in it) in order to remove the pull chain mechanism. Make sure the switch is off, remove the light bulbs and globes. There are usually three screws that hold the housing together, two through holes, and one through a slotted hole (you just have to loosen this one). Take the housing apart. It may be heavy, so if you can position something underneath it to support it, that will help. Inside the housing unit you will find the back of the pull chain assembly. They are usually threaded from the outside (the part you can see on the outside that broke) into a nut inside the housing. Just unscrew it and take it with you to your home improvement store to match. I believe you can find them in the electrical section. It's pretty simple to install, just screw it in the hole that you took the old one out of and you should be in business. Then simply screw the housing unit back together and put the globes and bulbs back on. Good luck!!!
You can buy a new pull chain switch at lowes / home depot. They are located with fan/lamp parts. You will have to disassemble the fan down to that region. The pull chain switch comes out by unthreading the nut visible on the out side of the fan (may look more like a decoration) then pushing the switch in through the hole. Follow the diagram instructions on the package, reassemble and TADA. The switch is like 3-5 bucks. Good luck