There are two steps to set up a 501c3. First you need to form a corporation, then you need IRS approval of your nonprofit status. the corporation step is very dependent on your state - different states have very different laws and procedures on incorporation.
MOE gave a talk many years ago on how to form your own 501c3 at the Championship robotic conferences. It's a little dated but the basic information is the same. It can be found at the bottom of the MOEU page at this link. There's been other talks, more recently, but i don't have the links handy.
http://moe365.org/moeu.php