Alex makes very good points, you want to be very careful what you indemnify for. My experience is that what companies are mostly concerned with is the case where your software infringes a patent and because your customer is using that software the patent holder can sue them (as they will probably have deeper pockets than you do).
This is where having a license agreement makes sense as it will cover these issues in a hopefully balanced way which provides protection for both yourself and your customer.
To answer your specific question here are the clauses we use with annotations, feel free to use any of this language that works for you.
So in this part we specify what we are going to indemnify them form with limits of what we will cover:
"Licensor will defend or settle, at Licensor’s expense, any action brought against Customer to the extent based upon a claim that the infringes any United States or European Union patent issued as of the Effective Date, copyright, trademark or trade secret, and Licensor will pay such damages and costs as are finally awarded against Customer attributable to such action, provided that Customer (i) notifies Licensor promptly in writing of any such action, (ii) gives Licensor sole control of the defense and/or settlement of such action and (iii) gives Licensor all reasonable information and assistance (at Licensor’s expense, excluding time spent by Customer’s employees or consultants) in connection with such action."
Then we define what our options are for resolving the problem:
"Should the Software become, or in Licensor’s opinion be likely to become, the subject of such an infringement claim, Licensor may, at Licensor’s option (i) procure for Customer the right to use the Software free of any liability; (ii) replace or modify, in whole or in part, the Software to make it non-infringing; or, if (i) and (ii) are not commercially practical, (iii) terminate this Agreement and refund a pro-rata portion of the license fees paid by Customer based on a three-year straight-line amortization of such license fees."
And lastly we make sure that it's our software that actually caused the infringement:
"Licensor assumes no liability for any infringement arising from: (i) any method or process in which the Software may be used; (ii) any compliance with Customer’s designs or specifications; (iii) use of other than the current unaltered release of the Software; or (iv) the combination, operation or use of the Software with any third-party programs, data or hardware. THE FOREGOING IS LICENSOR’S ENTIRE LIABILITY AND CUSTOMER’S SOLE REMEDY FOR ANY CLAIM THAT THE SOFTWARE INFRINGES ANY INTELLECTUAL PROPERTY RIGHTS."
Although if I was going to shorten this I would probably leave this part out based on how customers use our software.
You also asked about limiting your liability which Alex also brought up. If you're going to add indemnification I would add something that limits your liability for all cases, including things like missed appointments as Alex mentioned.
This is what we use. To make it more palatable we make it reciprocal.
"NEITHER LICENSOR NOR ITS LICENSORS WILL BE LIABLE FOR ANY LOST PROFITS, LOSS OF DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, OR EXEMPLARY DAMAGES ARISING OUT OF OR RELATING TO THIS AGREEMENT, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY (INCLUDING NEGLIGENCE), EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Customer acknowledges that the amounts payable hereunder are based in part on these limitations, and further agrees that these limitations shall apply notwithstanding the failure of the essential purpose of any remedy. Licensor’s total and cumulative liability arising out of or in connection with this Agreement shall not exceed the license fees paid by Customer hereunder."
Hope that helps.
disclaimer: I'm not a lawyer and this should not be considered legal advice.