From what you're saying, it doesn't sound like you have an infection as sores definitely are present with herpes. You might be panicking after seeing your friends sore in his genital area. Its good that you went to your doc and he reassured you and treated you. Maybe you should go back for another check just to put your mind at rest.
But please be cautioned not to have anal penetration. Your anus is not designed for this and long term consequences come as per my message above; people don't tell you this in the gay community, but its well known in medical circles. Take this incident as a warning and if you continue homosexual play, avoid anal penetration, it isn't good for you, at all.