In this paper, I develop an integrated approach to collective models and matching models of the marriage market. In the collective framework, both household formation and the intra-household allocation of bargaining power are taken as given. This is no longer the case in the present contribution, where both are endogenous to the determination of equilibrium on the marriage market. I characterize a class of "proper'' collective models which can be embedded into a general matching framework with imperfectly transferable utility. In such models, the bargaining sets are parametrized by an analytical device called distance function, which plays a key role both for writing down the usual stability conditions and for estimation. In general, however, distance functions are not known in closed-form. I provide an efficient method for computing distance functions, that works even with the most complex collective models. Finally, I illustrate my results with a proof-of-concept application that uses PSID data. I identify the sharing rule and its distribution and consider two counterfactual experiments of women empowerment, both of which are shown to affect the sharing rule and the investment of couples in public goods