When a project like Rosetta is being developed, how are flight plans calculated? Do planners simply input the desired target into a program or a flight computer which spits out the optimum flight path incorporating (multiple, if need be) gravity assists also taking other considerations like fuel into account? Do all space agencies have their own in-house software or do they use a common application? I'd appreciate more details on this.
While I do not have any special insight into the how the Rosetta flight profile was calculated, the general idea is as follows:
First, you start with an ephemeris model which contains the position data of all the bodies of interest over the time of your mission. These values used to be tabulated for planetary bodies and published in almanacs but are now usually numerical models that may contain the descriptions of thousands of bodies. As an example, the Jet Propulsion Laboratory (JPL) maintains an online ephemeris tool called HORIZONS which can be found here.
Once you know where everything is, or is going to be, you need to calculate your flight path. At this point, your problem is now a combination of orbital mechanics and multi-variable optimization. As far as I know, there is no standard program used in the calculation of these mission profiles. In fact, this is an area of active research.
Most of the orbital mechanics of gravity assist are well understood so the active research focuses on the different optimization methods to find the best mission profile. Since you mentioned the Rosetta mission, the European Space Agency (ESA) has a pair of papers (here and here) available on its website on the topic. The introduction to the first paper, in particular, explains both the "traditional" approach and outlines some of the improved optimization techniques currently being investigated.