The act of rimming is using your tongue on the anal rim of another person in order to gain and/or give sexual pleasure

There is no data to suggest that anyone has caught HIV from rimming, although there are other risks.

Hepatitis A is most often caught from rimming and gonorrhoea can also be passed on this way. There are also a number of gut infections you can get from rimming. Even a recently washed the area may carry some extremely infectious, microscopic organisms, but there is an even greater risk if you rim someone who hasn't washed beforehand, or who is suffering from diarrhoea. 

The risks associated with rimming can be prevented by using a dental dam, although not many guys use them. You can get a vaccination against hepatitis A and B at your local GUM clinic.