You can do this:
var user = db.Users.Find(userID);
var friend = db.Friends.Find(friendID);
user.Friends.Add(friend);
db.SaveChanges();
When you add the Friend
instance to User.Friends
, that tells EF to insert a record in the join table when you save.