We perform threshold resummation of soft gluon corrections to the total cross sections and the invariant mass distributions for production of a top-antitop quark pair associated with a heavy electroweak boson V=W+, W− or Z in pp collisions at the Large Hadron Collider. The resummation is carried out at next-to-next-to-leading-logarithmic (NNLL) accuracy using the direct QCD Mellin space technique in the three-particle invariant mass kinematics. It is found that for the ttˉZ process the soft gluon resummation introduces significant corrections to the next-to-leading order (NLO) results. For the central scale equal to the ttˉZ invariant mass the corrections reach nearly 30%. For this process, the dominant theoretical uncertainty of the cross section due to the scale choice is significantly reduced at the NLO+NNLL level with respect to the NLO results. The effects of resummation are found to be less pronounced in the ttˉW± case. The obtained results are compared to recent measurements performed by CMS and ATLAS collaborations at the LHC.