The examples in this post are taken from Danish: An Essential Grammar, although some may be slightly altered depending on if I can think of a better example using words in the course. For this post I will split all of the compound nouns up using "|", however this is just for clarity and they aren't written that way in any Danish text.
The first element of a compound noun can be a noun, verb, adjective, pronoun, numeral, adverb, preposition or word group. The second element of a compound noun is always a noun (there are also compound adjectives and verbs, but those are stories for other posts).
Here are some examples of all these different word classes in the first element of the compound noun
Noun: møbel|firma (furniture company)
Adjective: fjern|syn (television [lit. distant sight])
Pronoun: selv|hjælp (self-help)
Numeral: ti|år (decade [lit. ten year])
Verb: gå|gade (pedestrianised street [lit. walk street])
Preposition: over|klasse (upper-class)
Adverb: frem|tid (future [lit. forward time])
The -s- and -e- Links
A compound noun will usually have an -s- link if:
The first element ends in any of the following suffixes; -dom, -else, -hed, -(n)ing, -sel, -skab. For example:
kirstendom|s|undervisning (Christian education)
ledelse|s|struktur (management structure)
sundhed|s|arbejder (health worker)
landing|s|bane (runway [lit. landing track])
redskab|s|skur (tool shed)
The first element ends in suffixes borrowed from romance words; -ion-, -tion, -tet, -um. For example:
opinion|s|måling (opinion poll)
navigation|s|skole (navigation school)
universitet|s|uddannelse (university degree)
museum|s|besøg (museum visit)
If the first element is a compound word in itself. For example:
rød|vin|s|glas (red wine glass) but vin|glas (wine glass)
skrive|bord|s|skuffe (desk drawer) but bord|skuffe (table drawer)
A compound noun will sometimes have an -e- link if:
The first element ends in and the second element starts in a consonant. For example:
hund|e|mad (dog food)
sogn|e|præst (parish priest)
When the -ing suffix is used. For example:
Viking|e|flåde (Viking fleet)
First Element Forms
When a noun, the first element is usually singular (bil|sæde (car seat)) unless referring to a plural concept (børn|e|have (nursery/kindergarten), blomster|bed (flowerbed)).
When an adjective, the first element usually takes its basic form (gråt vejr -> grå|vejr), but there are exceptions (nyt|år (new year), små|kage (biscuit/cookie)).
When a verb, the first element is found in its infinitive form (vaske|maskine (washing machine)), although occasionally the verb stem is used (byg|mester (foreman))
Although there are exceptions, hopefully that leaves some good rules to follow when you go about trying to figure out what on earth an extremely long word actually means!