Consider the following examples:
- These people are good to know.
- The students are difficult to teach.
- This exercise is tough to do.
In the examples above we see infinitives occurring as the Complements of various adjectives. We cannot use -ing forms with the same meaning. The following examples are ungrammatical.
- *These people are good knowing.
- *The students are difficult teaching.
- *This exercise is tough doing.
Notice that all of the examples above have very normal Subjects. The Subjects in the sentences above are all noun phrases.
Now look at these sentences. They are a bit more unusual:
- Knowing these people is good.
- To know these people is good.
- Teaching these students is difficult.
- To teach these students is difficult.
- Doing this exercise is silly.
- To do this exercise is silly.
These sentences all use clauses as Subjects. They either use infinitival clauses or -ing clauses as Subject. They also have adjectives as complements of the verb BE. These sentences are unusual. We don't like to use clauses as Subjects in English. We prefer to use special sentences called extraposition constructions. To do this we stick the meaningless word it in the Subject position. We then move the clause to the end of the sentence. If we do that with the examples above, we will see that the clause now appears after the adjective:
- It is good to know these people.
- It is good knowing these people.
- It is difficult to teach these students.
- It is difficult teaching these students.
- It is silly to do this exercise.
- It is silly doing this exercise.
Although these clauses appear after the adjectives, they are not Complements of the adjectives. They appear after the adjectives outside the verb phrase. We call these Extraposed Subjects. (They aren't real Subjects though. The word it is the Subject in each of the examples above.)
Both -ing clauses and infinitive clauses can occur as Extraposed Subjects. The meaning of the sentences can be subtly different in each case. But they are both grammatical.
The Original Poster's example
- It is wonderful feeling free.
- It is wonderful to feel free.
- It is wonderful being free.
- It is wonderful to be free.
The sentences above are all grammatical. We can use either infinitives or -ing clauses here. The reason is that these clauses are Extraposed Subjects. They are not Complements of the adjective wonderful.
There is a very small group of adjectives which cannot normally take either infinitives or -ing forms as Complements. One of these adjectives is the word possible:
*The screen was possible to see. (ungrammatical)
However, we can use these adjectives in extraposition constructions - but only with infinitives, not with gerunds:
It was possible to see the screen.
*It was possible seeing the screen. (ungrammatical)