Stay calm and remove him. You can do this either by sliding your finger in or by pushing his face into your boob so he has to open his mouth to breathe (I personally prefer the first way, because it seems less scary, but it's up to you). Say something firm and brief, like "That hurts, please don't bite me." And then maybe put him down and/or ignore him and/or don't latch him on again for a little while. This last part I think you have to do based on your baby's personality. It should send a clear message that biting is not funny and it's not a game, but it shouldn't be so harsh that it's scary.