The Prophet (peace and blessings be upon him) said:
"A pledged animal may be ridden in return for its upkeep, and when a milch animal is pledged, its milk may also be drunk in return for its upkeep."
Hadith Referenceصحیح الجامع الصغیر / حرف الراء / 3562