It took a long time to get over the cold.

Literal

Cold [subject-が] heal [purpose-のに] long took.

治るのに長くかかった uses 治る (intransitive 'to heal/get better'), distinct from 治す (transitive 'to cure'). のに here marks the purpose of the duration — 'for the cold to heal.'