Device-to-device (D2D) communications underlaid massive multiple-input multiple-output (MIMO) systems have been recognized as a promising candidate technology to achieve the challenging fifth-generation (5G) network requirements. This integration enhances network throughput, improves spectral efficiency, and offloads the traffic load of base stations. However, the co/cross-tier interferences between cellular and D2D communications caused by resource sharing is a significant challenge, especially when dense D2D users exist in an underlay mode. In this paper, we jointly optimize the channel assignment and power allocation to maximize the sum data rate while maintaining the interference constraints of cellular links. Due to the lack of network-wide information in large scale networks, resource management and interference coordination is hard to be implemented in a centralized way. Therefore, we propose a three-stage stable and distributed resource allocation and interference management scheme based on local information and requires little coordination and communication between devices. We model the channel allocation optimization problem in the first stage as a many-to-one matching game. In the second stage, the algorithm adopts a cost charging policy to solve each user’s power control problem as a non-cooperative game. In the third stage, the algorithm search for swap blocking pairs until stable matching exist. It is shown in this paper that the proposed algorithm converges to a stable matching and terminates after finite iterations. Simulation results show that the proposed algorithm can achieve more than 86% of the average transmission rate performance of the optimal matching with lower complexity.