It is often not necessary to have long primers. with 4 base possibilities and 30 positions 4exp30 is huge and the oligo is unneccesarily long for unique binding to the genome. Longer primers need higher and more costly purification.
When the primer gets too long there is an increased chance of some part of the sequence annealing to the wrong place and also hairpin production where one part of the oligo snaps back to bind to some other part of the same oligo.
The equations to calculate annealing temperatures do not work for longer oligos which may be a problem.
Having said this there are good reasons for designing longmers. In denaturing gel electrophoresis we often make a 60 mer where 20 bases are unique to the sequence and 40 bases are gc rich to bind the end of the pcr product to get controlled melting of the product. Longoligos are made to cover plasmid/insert boundaries for incresed specificity of amplification or for sequencing primers wher part of the primer is sequence specifuc and the outer end binds m13 or sp6 sequencing primers. Very long primers are built to make artificial genes by double starnding the longmers and ligating or annealing sequences and then making the whole concatomer double stranded to make useful sequences of thousands of bases in length where they cannot aesily be amplified from natural sources.
Really nothing unusual happens above 30 bases...many people use them routinely and they usually work well if the 3' ends of the primers are well designed
Im going to turn your question on its head: Its not that you need to design primers 18-30 nucleotides long; Its that most applications using primers - principally PCR q/RT PCR and Big dye sequencing require primers with a melting temp of (on average) between 55C and 65C:
Based on how melting temp is calculated, i.e. the 'basic method' which requires that you simply assign purines (G & C) a value of 4C and pyrimidines (A & T) a value of 2C; or the so called 'nearest neighbour' variant on that method which takes account of the fact that with consecutive runs of A/Ts the primer Tm will be lower than that predicted by the basic method linked to intrinsic base composition alone; or conversely that GC intense regions of primers will elevate the melting temp of a primer compared to the 'basic' base composition formula; or indeed the so called 'salt adjusted algorithm, which takes account of the fact that ions present in a reaction, e.g. K+ Mg+ or Na+ will either stabilise or destabilise a duplex and thus affect local melting.....
Then with an average GC content of 50% and an anticipated melting requirement of 55-65C then most primers based on melting calculations derived on the above principles will inevitable approximate to 18bp to 30bp in size and will invariably be ~ 21bp, unless GC rich, in which case they may be as short as 18bp or AT rich, e.g. in many plant sequences where they might be up to 30bp
So it really depends on requirements
As mentioned by Paul for more niche applications you can make primers longer; indeed you can have them any length these days you like
The only proviso I would make is that based on primer synthesis theory for primers up to 30bp standard 'desalting' will suffice in purity for primers up to 30bp but above 30bp they require an extra purification step; typically reverse phase chromatography; HPLC or PAGE purified; that is the exact full sized band is extracted from an acrylamide gel and subjected to scrutinous purification. The reason for extra purifications of large primers is that some of your primer population will be truncated in size - so called failure or N-1 products and these will start to make up a significant proportion of the total population, i.e. > 30% and this can lead to mixed populations in sequencing reactions for example
To put the above in context: If I were to design a primer with a melting temp of 65C; with a GC content of ~ 50% that would approximate to 21/22bp and I would order as at standard desalted purity
If however, I decided at add an adaptor (say) incorporating a restriction enzyme site of an extra 10bp onto that basic sequence to anneal, I would order this 31bp 'tailed version of this primer @ a higher purity grade, e.g. HPLC purified
That said keep in mind what Paul said about the equations I describe working for typical length primers but falling short for longer primers