In this paper, we propose an interference management scheme for device-to-device (D2D) communications in cellular networks. Considering the underlay D2D communications, the signal quality of cellular users would be affected by D2D users. To solve this problem, we explore the application of network coding and relay-assistance to mitigate interference. In the proposed scheme, helper nodes overhear the signal from cellular users, encode the received packets, and send the encoded packets to the base station. We design the helper node selection scheme and the transmission policy of helper nodes.The performance of the proposed scheme for different positions of the cellular user and D2D users is then evaluated.The results suggest that the cellular transmission scheme should be adjusted dynamically when underlay D2D communications are active. Compared with the existing solutions, the proposed scheme can effectively increase system throughput.