As an undergrad in research, how should I deal with a uncommitted PhD co-worker? I'm a sophomore in CS planning on grad school, so I asked Prof. A to do research, hoping that I may eventually get some publication (which was understood). 

Prof A. is THE star in our department (and in the field as well) and is all busy fundraising, giving talks, etc. So as I expected I was assigned a PhD student B to work with (so this is B's project). Basically I'm building the software infrastructure of online surveys related to the research, and B is responsible for giving me data so I can populate my survey templates and publish them online.

Now the problem is that B has put off their share of his work (or at least it seems) repeatedly -- they'd promise "I'll take a look at your UI tomorrow and give you feedback" -- then two weeks would pass by, I'd email, and eventually get back to me one week later ("sorry I got busy..."). This has happened a few times, and I believe I finally have the UI the way it was wanted and the entire system ready to deploy -- but seems to be unable to  deliver me the data. Again I emailed, still no responses. No luck finding the Prof in their office either.

I'm not sure if it's a good idea to tell Prof A. about this (who after all  funds this project)... I have put in too many hours of work (for free) to quit this project, and worst yet the Prof I'm working for doesn't seem to care, and I never dared to ask about authorship (so there's no promise). What should I do?
You seem to be in a complicated situation: you are doing grunt work for a person who is not very committed to it, and on top of that you don't know if you will get anything back (the authorship issue). They say that hindsight 20/20, but you should have discussed both the authorship issue and the project timeframe (deadlines, milestones) before getting involved. That would make it much easier to get the PhD student to do his work by reminding him of the deadlines and of your stake in the project. If you are just supposed to get no authorship or only a footnote acknowledgement, you could let it be and let the PhD student dictate the pace of work. When you don't have a stake in the paper, you are not losing anything if it gets delayed and someone else publishes it before you. It is his loss, not yours.

Now, in your current situation, I would approach the student (perhaps together with the PI) and ask about the timeframe for the project and if there are deadlines. This will automatically have the effect of reminding the PhD student that he has to do his part of the work. It will also get the PI's attention without looking like you are complaining about the PhD student to him. While you are at that, you can also try to get your authorship doubts solved by also asking if there will be any paper written and what will your role be in that.

You are doing undergraduate research work, but you are not meant to be anyone's servant. Once you have put work into it, it is your right to know that your work is not done for nothing.