I asked the same question directly to a certified Apple tech at a third-party service center, whether a do-it-yourself hard drive replacement would void the warranty/Applecare on a previous generation MBP. He told me that technically, yes, it does void the warranty. I asked him how someone at Apple would know I had cracked the case to get to the HD if I did it correctly, and he said there were some little tabs that would be broken, which were replaceable by authorized repair technicians. I don't know if it's a form of tape, or what it is. Since I had just purchased Applecare, I did pay $45 to have him swap my hard drive for a new one. I already had cloned my original drive, so he didn't charge me for that part, just the labor to swap.
I mentioned that I could have easily done this myself, and how it could get expensive if I had to have my MBP fixed under Applecare, because I'd have to re-install my original drive first, or risk losing my new 500 gig drive, and then do the swap again once the laptop was fixed. At $45 a pop, that adds up. He told me that if I brought the MBP to his shop for an Applecare or warranty issue about something else, like motherboard, gpu, etc, he wouldn't even worry about the hard drive, and would leave it alone. Even if I had replaced it myself, unless I had done some obvious damage he'd just ignore that and deal with the actual problem.
So, from my experiences, there are a couple of approaches: the
by-the-book approach when dealing directly with Apple and the possibility that the warranty could be considered void simply by opening up your MBP (previous generation) and messing around - if they detect it... also, likely replacement of any aftermarket HD and memory modules back to factory original specs... which could be an unpleasant surprise;
...and the
third-party-certified-repair-shop-friendly-technician-who-uses-common-sense-and knows-what-he's-doing approach.
I think both scenarios have their pros and cons - depending on your situation. Just locate your resources before any serious problems hit, so you know which way to go when the time comes, and you don't go down the wrong 'approach' path for the specific repair/problem you've got. It's all about minimizing problems, not adding to them...