I stumbled on this completely by chance. I was listening to music on my phone at work one day and the cord on my headphones kept touching the screen and causing it to swipe and click on all kinds of stuff. When I got home I pulled out some old headphones and tried them out. Every ipod/phone cord I tested worked and an old Zune headphone cord worked as well but some other random headphones did not so be sure to test the cord you want to use before you cut it up. To test them out I just looped a section of the cord and tried to swipe the screen with it. I was disapointed to find that it doesn't work with my Surface tablet though :/ This was with a Nokia Lumia 822. Other phones and tablets may be different in how sensitive they are, or exactly how they sense touch.
All I did to make the stylus was take a ball point pen and pull out the ink tube. then I cut out a section of the cord and slid the two ends into the tip of the pen untill there was just a little nub of a loop left sticking out. Thats it. I did try using shorter and longer pieces of the cord but it didn't seem to make a difference in how well it workes. For my phone it doesn't work flawlessly all the time but then again the store bought one's i've tried don't either. The ipod cords seem to work a little better then the Zune.