For me I suppose it's a tossup between melody-first-chords-second and chords-first-melody-second. It usually depends on the situation: If I'm out and about, I may come across an idea in my head, usually a melody. Whereas if I'm at the piano trying to generate ideas, it's usually something chordal at first that I build off of.