There are 2 ways I have done this. One is to go from our PBX to a wireless phone system we used to have - both on the same premises. I put a T1 card in the PBX and the wireless already had one so I just hardwired the two together, set it up as a trunk group, and set up a block of extensions on the PBX to use the wireless. Obviously anything that wasn't already in the wireless's dial plan it routed across the same trunk group to the PBX. You could basically do this same thing through the outside using a T1 line provided by the phone company, and in that case you would need a CSU on both sides to make the connections.
The other way I've done it, but it was over 10 years ago, is to have one or more leased lines between the buildings (more expensive than T1's now) and set them up as E&M tie lines. In that case we had to dial 83 (so we didn't blow the whole '8' block of numbers) and then the extension. The dial plans on both switches were set up so that if someone dials '83' it sent the digits that followed (the extension) to the other side just like a DID call.
Both of those worked at one point or another for me.