I enjoyed the NOLO book "Consultant & Independent Contractor Agreements": https://www.amazon.com/Consultant-Independent-Contractor-Agr... (look up the prior editions for reviews)
The majority of the book is agreement templates, including one for software development. But more importantly, it walks through the language and what you should be looking for -- interestingly, both from the perspective of an employer and contractor. Of course, it's also helpful/recommended to get feedback from a lawyer for your specific situation.