I'm not sure how it works elsewhere, but in Canada funding from CCS & the Terry Fox foundation goes to universities and research hospitals, *not* for profit pharmaceutical & medical companies. The funds are also earmarked for research only, specifically not to be used for legal costs, manufacturing, etc.
Depending on the province IP will be owned by either the researcher themselves or the university. They will then license for-profit companies to use it, where they do the funding of final human trials, manufacturing, and bringing it to market. This lets the foundations themselves remain non-profit entities, and researcher/university are able to self fund future research from license fees. It is also common practice for these licensing agreements to have clauses that stipulate a portion of the profits from marketed treatments be directed back to the non-profits that initially funded them as well, ensuring they continue to function.
