This is one of my main worries about my impending graduation. Right now, I work on what I find interesting, publish when I have what I think are good results, and have not found that anyone has tried to dictate what I should be working on. Once I graduate though, I'll lose that luxury. Unfortunately I don't know of any "real-world" job that provides such freedom; perhaps grad students are only afforded it because we're so affordable.