How does CDI work when flying to VOR without DME?
The VOR and ILS CDI indicates difference, in degrees, between the radial selected and the radial sensed.

If the plane was far from the VOR and we turn the course pointer 5 degrees, the CDI will move to one side. If the plane was close to the VOR and we turned the course pointer 5 degrees, the CDI would move exactly as much, because it indicates the angular difference in degrees.

This is in contrast to a CDI slaved to GPS, which indeed indicates lateral distance from the selected track in miles (en-route; GPS approach has to simulate ILS).

VOR does nothing with DME. DME is completely independent piece of equipment that was introduced later than VOR. The only relation is that there is a standard correspondence between VOR and DME channels and the DME receiver automatically tunes to the DME frequency corresponding to the VOR or ILS frequency tuned on your VOR/ILS receiver.