Let's treat the "normal" and "lost communication" cases separately.
Fly assigned heading for RADAR vectors to assigned route. Climb and maintain 10000 or ATC assigned lower altitude. Expect filed altitude 10 minutes after departure.
The essence of this is that on departure, responsibility for navigation rests with the air traffic controllers, not the pilot. The controllers will issue headings and routes to fly in order to keep the aircraft separated from other departures, arrivals, and other traffic. Once clear of traffic, the controller will issue instructions on how and where to rejoin the cleared route. At this point the pilot takes over responsibility for navigation along the cleared route.
Usually, it goes something like this. The departure will be assigned an initial heading, often the runway heading: "runway 17R, fly runway heading, cleared for takeoff." The aircraft flies this assigned heading. The aircraft will then contact the departure controller. The departure controller may continue assigning specific headings in order to separate the aircraft from other departures, arrivals and other traffic. Once clear, the controller has some options. They can clear the aircraft direct to a convenient fix/waypoint or NAVAID on the aircraft's flight plan ("Proceed direct ADANE, resume own navigation") or they can say something like "Fly heading 130, join the Denver 159 radial, resume the departure." It's up to them, but they will issue some kind of instruction that results in the aircraft joining its cleared route.
LOST COMMUNICATION: If no transmissions are received within one minute after departure, maintain assigned heading until 7000 feet, then climb to filed altitude via direct DEN VOR/DME, thence via assigned transition. If filed altitude is above 10000 feet, cross DEN VOR/DME at or above 11000 feet.
If communication is lost, the pilot should do the following in order once it is realized that communication has been lost.
- Fly the last assigned heading until reaching 7,000'.
- Turn (back toward the airport and the DEN VOR) and fly to DEN.
- Comply with the crossing restriction (make sure you reach 11,000' before getting to DEN if your filed altitude is above 10,000').
- At DEN, turn outbound on the appropriate (filed/cleared) transition leg.
- Keep climbing to the filed altitude.
It is likely that some short amount of time will pass before it is realized that communication has been lost. The aircraft will travel some distance away from the airport during this time. The aircraft must also continue until it reaches 7,000'. So by the time it would become necessary to "proceed direct DEN," the aircraft will not be "right next to it" and a turn direct DEN is reasonable.
If you departed runway 25, your route might look something like this (not to scale!).