To expand on what Byboeren says, "nogen" without anything following it usually means "somebody/anybody". For example "er der nogen?" usually means "Is some/anybody there?". Noget is used for objects or "concepts", for example "er der noget galt?", which means "is something wrong?"
However, like you yourself wrote, nogen and noget can also mean "any" if they are followed by nouns. The gender and number of the noun determine which word is used.
For example, en-words like "lampe - lamp, take "nogen"."There isn't any lamp here" becomes "Der er ikke nogeN lampe her", because the word "lampe" has common gender, en.
Et-words take "noget", for example "bord" - table. "There isn't any table here" becomes "Der er ikke nogeT bord her" because the word "bord" has neuter gender, et.
For all plural nouns, regardless of gender, use "nogen" if there are zero of the noun, and "nogle" if there are more than one; it basically translates to "some".
"Der er ikke nogen æbler her" ("There aren't any apples here") and "Der er nogle æbler her" ("There are some apples here".) Do you see the difference? Note how "et æble" is an et-word in the singular, but because it is in the plural, it becomes "ikke nogeN æbler".
I hope I'm not confusing you even further, as it's really tough stuff to memorize! You're more than welcome to ask for clarification if you need it :)