Mine used to do this. It got to the point where it used to take two of us to get to him into bed on a night. One to physically force him into bed and the other to try and make sure he wasn't attacking the first. It was stressful for both us and the dog 
There are easier ways.
Houseline. Keep one on your dog all the time he is in the house. When it comes to bed time hold the end of the houseline and lead him there, gently. He gets a treat for getting off the sofa. He gets a treat on his way to bed. He gets a treat once he's in bed.
Treats don't have to be food. My secret weapon is the tug rope. The tug rope is the single most exciting thing in the world. My terrier would follow me off of the end of the earth for the promise of a game of a tug.
Try tug ropes, squeaky toys, balls, raw or cooked mince (mine prefer raw), sardines, sardine cake, liver cake, dried liver, raw liver, cheese (the smellier the better), hotdogs, chicken wings (but as a treat instead of a meal, you don't want a fat puppy)
Just as an aside and not to upset you, the other posters are right. This was a warning, not a full on attack. When mine 'attacked' me I had puncture wounds in my hand and severe bruising to my thumb, which I could not move for at least a week. I still had my thumb, I knew my dog did want to or try to remove my thumb. Had he wanted to injure me that badly, he would have done so. Dogs do not try to attack. They either attack or they don't.
It is upsetting when your dog behaves in an unexpected and violent way and it can be very scary, especially when you were least expecting it, but in this case it's not the end of the world. I seriously doubt your pup has any major issues other than loving the comfort of the sofa.
Dominance is a big, fat, dangerous myth. Your dog is not trying to dominate you or anyone else. He just loves the sofa. That is all. He does not want to take over the world.