He has only played Nadal and Ferrer out of the top 8.
Don't forget his losing effort to #8 Andy Roddick in Memphis 2011.
Other players that Raonic has managed to beat inside the top 30 have usually been players that are not playing on their favorite surface. For example, clay court players playing on indoor or outdoor hard. Or he has beaten somewhat inconsistent faster hard court players in slower conditions.
Obviously, he also has trouble winning against higher quality players with good return games, even on surfaces that might favor him (ala Memphis and his loss to #38 Melzer).
His "breakthrough" event was probably the 2011 Australian Open where he successively defeated #24 Michael Llodra and #10 Mikhail Youzhny, before losing to #7 David Ferrer.
He then beat #9 Fernando Verdasco two matches in a row in 2 successive Indoor Hard
He then lost (inc. 1 retirement) to Verdasco in 2 clay court
events and lost easily to David Ferrer on clay
In 2012, he had his best tournament to date in India at Chennai Outdoor Hard
successively beating #10 Almagro, and then #9 Tipsarevic in 3 tiebreakers where Raonic served extremely well.
So, I think it will be difficult for Raonic to beat #3 Federer unless Federer is too sick.
Raonic would probably have to serve at 80% first serves or better to have a chance, and then he would have to break Federer, or beat him in the tiebreakers. Also, Federer is quite good against big servers and once he has read their serve (usually within a few services games) he uses their own pace against them to often block return winners. It will be a very difficult task for Raonic. Federer should win in 2 sets, unless Raonic serves very well and can take Federer in a tiebreaker.