As it happens with direct object pronouns, the participio passato of the verbs agree with the combined pronoun (-o, -a, -i, -e):
"Roberta mi ha chiesto dei libri e glieli ho prestati".
In case of a modal or phrasal verb (volere, potere, dovere, sapere, cominciare a, stare per, finire di) followed by an infinitive, the combined pronoun can either be used before the verb or after the infinitive:
"La bicicletta mi serve, non te la posso prestare"
"La bicicletta mi serve, non posso prestartela"