According to my grammar books (very old - like me... ) the word order in your bold sentence is to emphasise 'barn'.

Let me quote: "Another type of inversion [as you suggested] is that in which the subject comes at the end for emphasis. 'Now comes my best trick', 'to the list may be added the following names'."

To me, your sentence fits this structure exactly: 'North of the house was a barn.' Regrettably, my main source (Usage and Abusage) does not give this inversion a special name - we could call it 'an inversion of emphasis'. You asked if it is used for literary effect. I would say not specifically. I know I use it quite frequently. Someone asks me something about the Russian language and I am likely to reply, "I'm not sure, but in my office is a Russian girl, so I'll ask her tomorrow." This has more impact than the usual word order and emphasises that I'm not waffling but going to ask someone who will almost certainly have the correct answer.

You are absolutely right about the need for prepositions - not required - but, should you want to use one, in the case of your sentence it would have to be "to the north of the house was a barn."

...Regrettably, my main source (Usage and Abusage) does not give this inversion a special name...

Click to expand...

Given your curiosity, you might be interested in this list, found in a document from the University of Illinois, of the various constructions in which subject-verb inversion occurs.https://netfiles.uiuc.edu/k-lee7/www/kesl/writ/inversion_sv.pdf
This case seems to fall into the first construction mentioned in their list, "Adverbial fronting", specifically with the adverbial phrase being one of "location or direction":

Subject–verb inversion occurs in the following kinds of constructions:1.Adverbial fronting
An adverb or phrase with an adverbial meaning is put in initial position. This puts a little more emphasis
on the fronted word or phrase, and also provides a logical transition from the preceding sentence to the
current sentence. These include adverbs of frequency (seldom, rarely, always), adverbs of extent or
degree (= how much), and prepositional phrases of location or direction.

Click to expand...

The document goes into additional detail, including when the subject-verb inversion is optional and when it is required.

Normally to convey the meaning you want Blasita you would say "To the North of the house was......." For example, describing the situation of a country house...." set in 20 acres of rolling hillside, the house commanded panoramic views of the surrounding countryside. To the north of the house were the cascading hills of the surrounding countryside whilst to the south were the formal gardens for which the house was famous........on the left as you look at it from the main entrance-way you can see the famous folly" etc etc etc.
Add your own description and paint your own picture, but precede your geographical descriptions with the prepositions "to". "on"

North of the house was a barn.A barn was north of the house.There was a barn north of the house.

I would like to know the grammar behind the first sentence: name of the structure (some kind of subject inversion?) and use; is it mainly used for literary effect?

By the way, I don't think we need any prepositions, but if we wanted to add one, would 'to (the) north ...' be okay?
Thank you very much.

Click to expand...

Yes, you have it right; inversion is anything that reverses the usual or expected order: here, the subject "a barn" and the subject complement "north of the house" were inverted for literary effect, or simply to highlight that which was new information or more important ("north of the house"). Usually, the subject tends to be more specific: "a barn" is more specific than "north of the house," and therefore "a barn" fits nicely as the subject. We can also say that in north of the house was a barn, "north of the house" is the syntactic subject, while "a barn" is the logical subject.
cheers

https://netfiles.uiuc.edu/k-lee7/www/kesl/writ/inversion_sv.pdf
This case seems to fall into the first construction mentioned in their list, "Adverbial fronting", specifically with the adverbial phrase being one of "location or direction": The document goes into additional detail, including when the subject-verb inversion is optional and when it is required.

Click to expand...

This document is very helpful; thank you, CubaMania.

It is much clearer now. Thank you all for your help; I really appreciate it.

Yes, you have it right; inversion is anything that reverses the usual or expected order: here, the subject "a barn" and the subject complement "north of the house" were inverted for literary effect, or simply to highlight that which was new information or more important ("north of the house"). Usually, the subject tends to be more specific: "a barn" is more specific than "north of the house," and therefore "a barn" fits nicely as the subject. We can also say that in north of the house was a barn, "north of the house" is the syntactic subject, while "a barn" is the logical subject.
cheers

Click to expand...

Good explanation seven days, just one point, We don't say "in north of the house"

Good explanation seven days, just one point, We don't say "in north of the house"

Click to expand...

Thanks for catching that. It does look weird. Actually, I inadvertently italicized "in." What I meant was:
We can also say that in (the sentence) "North of the house was a barn," "north of the house" is the syntactic subject, while "a barn" is the logical subject.
Sorry for the confusion.
Cheers

I'm not sure the adverbial phrase "north of the house" is any kind of subject of that sentence.

Click to expand...

I agree. It's similar to the following.

Behind the house was a barn.

If we add "there" to the sentence, it seems clearer that the first part is not a subject.

Behind the house there was a barn.

"There was a barn" is the main part of the sentence, and "north of the house" seems to me to be a prepositional phrase that merely describes the location of the subject (a barn), and could of course be placed at the end of the sentence.

For "north of the house" to be a subject in "north of the house was a barn," it would have to mean that the name of the barn was "North of the House."