Excellent question. The first sentence is simply incorrect.
What I suspect you are looking for is "we used to work together," which would mean that at one point in the past, these two people worked together. The confusion may be coming from the fact that here we are looking at two different things:
to used to do = to have done for a period in the past (e.g. habitually)
to be used to doing = to be accustomed to doing, i.e. it is normal
Think of the second version as a special compound, "used to." It means accustomed. I am used to teaching — I do it every day. I used to sing a lot, but I don't anymore, so I'm not used to singing now. I would have to practice to be as skilled at it as I used to be.
I don't know which meaning you wanted in sentence 1. I hope this helps!