Depends on what happened exactly. There are a few common issues with E36 tranny's, ranging from 2nd gear blowing out (mine did), synchro's going bad, and popping out of gear. Not very common, but well documented nonetheless.
As for cost, it should be around $2300 so try to get a second opinion or another quote. No one gives you a new tranny. In fact, very few transmission places actually rebuild them. They just swap out the old one for a rebuilt one from a supplier.