In order to answer your question about your Moroccan friend visiting you in the USA, you will need you to provide a little more detail:
First of all, how long does your friend intend to stay? 90 days is generally the maximum time for foreign citizens to remain in the U.S.
Generally speaking, foreign citizens must obtain a Visa before entering the U.S. This can be either a non-immigrant visa, for temporary travel, or an immigrant visa, granted for permanent residence.
Visitor visas fall under the non-immigrant kind, for those wishing to travel to the U.S. On a temporary basis.
The visa waiver program may help people visit you in the USA
The Visa Waiver Program (VWP) allows citizens of certain countries to enter the U.S. Free, provided they meet certain stipulations. These countries are as followed:
A Andorra Australia Austria
B Belgium Brunei
C Chile Czech Republic
D Denmark
E Estonia
F Finland France
G Germany Greece
H Hungary
I Iceland Ireland Italy
J Japan
L Latvia Liechtenstein Lithuania Luxembourg
M Malta Monaco
N Netherlands New Zealand Norway
P Portugal
S San Marino Singapore Slovakia Slovenia South Korea S pain Sweden Switzerland
T Taiwan
U United Kingdom
Since Morocco is not listed here, it means that a Moroccan citizen must apply for a Visa to be admitted into the U.S.
One must take several steps in order to acquire a Visa. More information on how to apply can be found on the U.S. Embassy website listed below.
To see the cost of Non-immigrant (temporary) Visas, see the link below from the Morocco Section of the U.S. Embassy
Remember that, even if you do successfully obtain a visa, this never guarantees entry into the United States and they have the right to deny anybody upon entry.
More information on U.S visas can be found on their official website.