Dedicated film scanners are generally accepted to give the best results (and highest resolution) when scanning film. However it's very expensive to buy a good resolution film scanner that will handle both 35mm and medium format negatives.
Flatbed scanners, while they boast very high resolutions such as 9600dpi, in most cases are not capable of producing these resolutions without interpolation. In other cases the manufacturer states either the vertical or horizontal resolution of say 9600, if both vertical and horizontal resolutions are not 9600, then the true resolution is not 9600.
With a dedicated film scanner you do not need to go to such high resolutions to achieve the quality you need to print from.
An example of a good prosumer quality dedicated film scanner is the Plutek 8100 Ai which can produce file sizes of approx 400mb. You will likely never need files sizes of this size but many photographers scan at this size and then reduce the files to produce sharper, less grainy images.
An example of a good flatbed film (and reflective) scanner is the Epson Perfection V750 Pro which does not produce image quality even close to the Plustek mentioned above and costs more than twice the price. However, it is suitable for scanning medium format negatives at an acceptable file size as a medium format negative is over twice the size of a 35mm negative.
The down side to dedicated film scanning is the time it takes. A high resolution scan on a Plustek can take up to 7 minutes per neg whereas on an Epson it will be no more than 2 minutes per neg. You can also mount multiple negs and batch scan on a flatbed scanner and this is not possible on a dedicated film scanner.
One of the most important issues with scanning, whether it be on a flatbed or dedicated film scanner, is the software you use to drive the scanner. Most manufacturers bundle their own scanning software which is useable but generally does not get the best results from the scanner. There are professional scanning applications, such as Silverfast, that will deliver better results.
Hope this helps.