1) It is necessary to allocate a block of addresses from a range of RFC1918, which is not occupied in both companies and will be used to access the resources of each other
2) devide this block in two equal parts ( /24 prefix -> /25 + /25 for example )
3) each company will make a route to another's company reserved address block. For example it will be virtual-template based ipsec tunnel between them and static route to it (or even GRE tunnel or some kind of L2/L3 channel). This static route will be redistributed to any kind of dynamic routing protocol used inside each company (IGP) or you can use IGP or even BGP between companies through this VTI interface.
4) each company will make static mappings of their servers and optionally dynamic mapping for users accessing servers in inother company.
That's all. Really there is no big deal.
___
HTH. Please rate this post if it was helpful. If this solves your problem, please mark this post as "Correct Answer"