There's a complete explanation of the Special Effects used at FXGuide.com including videos of the fight being shot.
The Ted stuffie was essentially a real teddy bear with some posable joints and a loose neck. It was fitted with an aluminium rod that could be puppeteered. "We would block the scene with the actors so they had a sense of how big he was," explains Clark, "where he was and approximately what he was doing. Seth would do the lines during that rehearsal. I would follow along with the stuffie as best I could. We would shoot that as well, serving as a lighting reference and as a rehearsal."
In many cases, Seth McFarlane was in a motion capture suit for interaction but in the case of the fight it was all CGI replacing the stuffie held by Wahlberg.
If Ted was sitting on a couch or bouncing a bed, the reference pass would also include some physical interaction. "I had two little furry covered rods capped with approximations of Ted's hands," says Clark. I would poke the lounge or sheets or whatever he would deform, and try and poke it with the same amount of weight he would give. We could use that as reference or extract the area and use it in a comp."
For one series of shots in which Ted has a play punching fight with his long-time owner and friend John (Mark Wahlberg), the on-set interaction required Clark to jab the actor with the rods as reference. But this was nothing, in terms of what Clark had to do to Wahlberg, compared to a later scene in which Ted and John have a fight in a hotel room. "Ted grabs an antenna off a clock radio and runs over and pulls Mark's pants down and starts whipping his ass with it," says Clark.
"That's all good and fine but I had to do the reference pass for that! I went in thinking it'll be the stunt double, but I walk in and it's Mark laying there with his bare butt exposed. I had the radio antenna and I was pretending to hit him and he's reacting, and he goes, 'Hit me, hit me,' and I hit him once and it put this red welt right across his butt. Meanwhile Seth was screaming into a bullhorn saying, 'Hit him, hit him.' I survived and the shot looks great. I guess I can take from that that I'm one of the few people to say I beat Mark Wahlberg's ass."