Similarly to writers, composers definitely understand the meaning of the phrase 'writer's block'. I suffer from this all the time. I even find that I can go for two or three months without picking up my manuscript pad or jotting my ideas into my computer. If you look through the 'Composing for Dummies' book you'll find hundreds of handy tips that will get you 'composing' in no time - (don't buy it!) Similarly, if you type 'how to compose a piece' into Google, the first site comes up with 'Tip no.1, it is crucial that your piece has an introduction, a middle section and a conclusion'. Every musician knows that this is completely misleading, as classical music has a number of different structures and forms.
When I begin to write a piece of music, it's usually because I've been sitting watching tv and heard something that I like in a film or tv score, or even because I've whistled the same phrase for days, and I can't get it out of my head - almost as if it's a sign to write it down. I used to always start a piece with a single note held for about eight bars. Now, not all of my pieces end up with this introduction, but I find it useful to pick a note, listen to it being held, and wait for something to come to mind. Sometimes I begin to hum a harmony, sometimes I get a rhythm going with my feet - and sometimes all I can do is stare at the music with no inspiration at all.
However, since I started composing choral music, I found that the most useful tool when composing is having a text. Some of the standard texts like 'ave maria', 'sanctus', 'ave verum corpus' and 'magnificat and nunc dimittis' are the ones I'm talking about. The reason they are so helpful is because it gives you half the music already, this is because of the emphasis that we put on words. For instance, the phrase 'ave maria, gratia plena' would be said: (a-ve ma-RI-a, GRA-ti-a PLE-na). This natural emphasis makes it easier to come up with a melody or a rhythm. The most basic melodic example would be:
Here, the accented syllables are represented by a change of note. As well as thinking up music in my head, I take a lot of inspiration from other composers and pieces that I like - not always being classical. However, I find that particular genres are useful when searching for inspiration in a particular aspect of the music. For example, I find film music to be the best thing to listen to for subtlety and harmony, for accurate settings of texts, I find the most useful music to be requiems or Magnificats and Nunc Dimittis' (although I strongly believe that you can pretty much find everything you need by listening to Bach!).
The final way in which I find inspiration is by playing the piano or even the guitar. I find sitting down at the piano and playing endless chord progressions relaxing anyway, (maybe I'm one of few) but it leads you to places that you may not have thought of in your head. I would also say that other instruments would be helpful, however the piano and guitar are particularly good because they give you thick harmonies with multiple notes at a time, as well as an extremely wide range. Of course there are compositional processes for certain genres of classical music because they have to include the elements of the genre (e.g. minimalism must include repetition, addition, subtraction, cell displacement etc) but when starting off something of your own choice and style, finding the thing that gives you inspiration is all important.
I leave you with a variety of views about the subject from the pros:
'It is not hard to compose, but what is fabulously hard is to leave the superfluous notes under the table' Johanne Brahms
'Composing is like driving down a foggy road toward a house. Slowly you see more details of the house - the colour of the slates and bricks, the shape of the windows. The notes are the bricks and the mortar of the house' Benjamin Britten
'Life is a lot like jazz... it's best when you improvise' George Gershwin
'A symphony must be like the world, it must contain everything' Gustav Mahler
'Ever since I began to compose, I have remained true to my starting principle: not to write a page because no matter what public, or what pretty girl wanted it to be thus or thus; but to write solely as I myself thought best, and as it gave me pleasure' Felix Medelssohn