In class D and E airspace, there is no separation between IFR and VFR
traffic.
This is not a true or correct statement. In these airspace classes, there is no requirement by ATC to provide separation between VFR and IFR traffic. There must still be separation in order for flight to be safe, therefore the responsibility to maintain this separation ultimately rests with the pilots of both aircraft.
ATC is responsible for providing IFR-IFR separation in any controlled airspace. VFR pilots, for their part, are required to "see and avoid" other traffic around them. This is half of why the VFR separation minima exists; you as a VFR pilot must have sufficient visibility in all directions to be able to spot other aircraft and maintain a safe distance from them.
IFR pilots have the same "see and avoid" responsibility when operating in VMC; if ATC instructions would cause the pilot to violate separation minima with observed traffic that ATC doesn't seem to know about, the pilot receiving the instruction must respond that he cannot do as instructed because of the observed traffic, which will include a report of its general position. This is the other half of the reason for VFR separation minima; if you're not flying under direct guidance of ATC, other traffic, IFR or VFR, must be able to see and avoid your aircraft, and therefore you have to stay far enough away from clouds that you're either not a danger to anyone travelling through the cloud or around the other side, or they can see you with enough time to maneuver to avoid you if you are.
ATC may provide separation involving VFR craft in Class D/E airspace as information and workload permit. VFR traffic, while not required to maintain contact with ATC, may still do so, reporting position and altitude (if ATC doesn't have a radar fix) and receiving traffic advisories of anything ATC does know about. This doesn't relieve the VFR pilot's responsibility to see and avoid but it can help him stay aware of the presence of nearby planes. This becomes more important near major airports in dense areas of airspace, which is why Mode C veils exist; while within the veil, aircraft in Class E can be easily seen and their altitude known, even if they aren't talking to ATC. ATC can then advise IFR traffic to maintain separation.
Obviously, in IMC, pilots can't "see and avoid", therefore VFR flight is illegal and IFR flights have to trust and follow ATC instructions unless anything they might still see or know obviously indicates otherwise.