I married a lawyer, so she handles this for me. That's a potently dangerous strategy, so if your risk aversion is higher, you may try reading this book instead: Legal Guide to Web & Software Development http://www.amazon.com/Legal-Guide-Software-Development-CD-Ro...
Software Development: A Legal Guide
http://www.amazon.com/Legal-Guide-Software-Development-CD-Ro...
and
Consultant & Independent Contractor Agreements
http://www.amazon.com/Consultant-Independent-Contractor-Agre...
both by: Stephen Fishman J.D : NOLO press