This was already covered but here goes again:
Get your BS/MS (more on this down below) at a decent school, the reputation of the school means something but not alot. Look for professors or research groups that are doing things you are sort of interested in and see if they have an opening for an undergrad, this will be your first exposure to research work. You may have to volunteer to get this exposure but it is invaluable both in experience for the grad school apps and in recommendations. If this isn't possible then at least get to know a couple professors for good recommendations a professor that knows you will write a better letter than one that just knows your grade.
Some schools offer a fifth year MS program, if you are sure you want to work towards a PhD this might not be a bad idea (I know of a few people where I am at that did just this and it seems to have helped them) but it is usually a strictly coursework option, you'll do a year to 1.5 years of grad coursework at the end or after you finish your BS.
If you are unsure about the PhD you have two options:
1) Apply as a masters student and do a thesis, the thesis is kind of like a mini dissertation. It lets you try your hand at some small research project and if you hate doing the thesis then I can't imagine a dissertation would be something you'd want to do. Also if you do decide you want to do a PhD then getting a recommendation from a current faculty that might also be able to guarantee your funding is (at least where I'm at) an almost certain guaranteed entrance to the program. In addition at some schools getting into the MS program is easier than the PhD so this can be a nice little backdoor into a school you might have had a harder time with. Secondly when doing review for your thesis topic you may find your true research interests have changed and you can apply to a different schools PhD program that aligns with your interest better.
2) Apply as a PhD, do a MS thesis, if you hate it take your MS and run, if you love it you are already on your way.
If you are doing a PhD for monetary reasons as an engineer it doesn't pay off, the best payoff is a MS (I don't remember where I read this so you'll just have to take my word on it). Doing a PhD because you are interested in research is really the only reason you should be doing it. The types of positions opened up with a PhD in industry are typically R&D, if thats not your interest you can stop at a MS and do what you want to do.
So as to not sound like I am making stuff up I'm currently working on my MSEE doing a thesis an my current advisor wants me to stick around in his group for a PhD but I'm still fence sitting.