I'm writing a non-comedic fantasy novel, and I find myself using onomatopoeic words, like "SLAM!" and "TWISH" (for the shooting of arrows). To my knowledge, onomatopoeic words are almost only used in cartoons and comic books/manga. Perhaps also in cinematography which is derived from set genres. But what about using it in writing, in a non-comedic fantasy novel?
Unlike with comics, you wouldn't want to use sound effects as dialogue or dialogue adjuncts (in comics the letterer makes them separate from actual speech), though you can get away with it in something humorous.
You can, however, evoke sound effects.
The door slammed shut.
She shut the door hard.
She nocked another arrow, let it fly, and smiled as it hit the target with a satisfying thunk.
She nocked another arrow, let it fly, and smiled as it hit the target's rings.
These are fairly subtle examples but they each use words one might imagine in a comic but in regular narration. I left out "twish" as it isn't one that ahem speaks to me.
You can also bring sound into the narration more directly. This is basically the point of the sound effects; they're shorthand for narration. Describe the background noises just like you would the scenery. Use sounds for emotional impact just like you would the feeling of air whooshing by (another sound effect word).
Make your auditory world as rich as your visual one. But do it with solid narration, not with shortcuts.
Fair warning: as a reader I have a pet peeve about onomatopoeia; I dislike it intensely as it tends to break my flow when reading. This is usually when non-word syllable strings are used rather than proper words but my aggravation carries over to all forms.
You can use onomatopoeia in any genre - at least you certainly can if you're using a first person narrative; I'm not completely sure about third person, but I wouldn't. In first person you're describing the experience of the narrator so onomatopoeic language is an appropriate mechanism. However onomatopoeia does not translate well, if at all, across people and cultures: what one person thinks the word "twish" sounds like is not the same as another. Nor in fact is one person's experience of what an arrow sounds like going past going to match that of any other particular person.
You can certainly use them; but you have to set them apart from the text in a very deliberate way. You can italicize them, encapsulate it in em dashes, both...
As long as you do not overuse them, or--if you do use more--make sure they are clustered. One cluster or word per three or four pages at a maximum, I'd think. Therefore, only use them when they actually add to the verisimilitude of a scene.
At the same time, do not use them too little, either. They have to be part of the overall style of the story for your reader to grow accustomed to them. For this I cannot really give any indicatives, sorry.