The B2B companies are often started by older folks in their 30s and 40s. (E.g. PeopleSoft human resources software started by David Duffield age 46 and Siebel CRM software started by Tom Siebel age 41. Both were acquired by Oracle.) Their accumulated years in the industry gives them the relationships to convert into their first enterprise customers. Even more fundamentally, a B2B startup solves a "paint point" for corporate customers. Therefore, it makes sense that the founders would have spent many years working for companies (as employees in their 20s and 30s) to intimately understand how to solve their problem. Being a 40-something founder is the natural timeline for all that to happen.
However, many prominent B2C companies are started by 20-somethings (e.g. Google (age 25), Facebook (age 19), Snapchat (age 21), Instagram (age 27). The top-100 consumer-facing iOS & Android apps on their app stores are probably done by younger founders. It's hard to think of consumer-facing internet companies that were started by 40-somethings. (Netscape in 1995 with 50-year-old Jim Clark would be an uncommon example.) The B2C world doesn't require existing industry relationships; it's the viral spread of software to create network effects rather than a 6-month sales cycle of B2B.
It's the B2C companies that get more coverage on WSJ, Bloomberg news, and even tech sites like HN. Readers will click on more stories with "Snapchat" (B2C) in the title rather than "Palantir" (B2B). Therefore, it seems like the startup world is skewed towards 20-somethings.