Dzyaloshinskii-Moriya anisotropy in nanomagnets with in-plane magnetization