This paper studies a wireless powered mobile edge computing (MEC) system with device-to-device (D2D)-enabled task offloading. In this system, a set of distributed multi-antenna energy transmitters (ETs) use collaborative energy beamforming to wirelessly charge multiple users. By using the harvested energy, the actively computing user nodes can offload their computation tasks to nearby idle users (as helper nodes) via D2D communication links for self-sustainable remote computing. We consider the frequency division multiple access (FDMA) protocol, such that the D2D communications of different user-helper pairs are implemented over orthogonal frequency bands. Furthermore, we focus on a particular time block for task execution, which is divided into three slots for computation task offloading, remote computing, and result downloading, respectively, at different user-helper pairs. Under this setup, we jointly optimize the collaborative energy beamforming at ETs, the communication and computation resource allocation at users and helpers, and the user-helper pairing, so as to maximize the sum computation rate (i.e., the number of task input-bits executed over this block) of the users, subject to individual energy neutrality constraints at both users and helpers. First, we consider the computation rate maximization problem under any given user-helper pairs, for which an efficient solution is proposed by using the techniques of alternating optimization and convex optimization. Next, we develop the optimal user-helper pairing scheme based on exhaustive search and a low-complexity scheme based on greedy selection. Numerical results show that the proposed design significantly improves the sum computation rate at users, as compared to benchmark schemes without such joint optimization.