To solve this problem, we first need to define the decision variables and the objective function. Let's denote the number of cars washed as `x` and the number of buses washed as `y`. The objective is to maximize earnings, which can be calculated as `$50x + $75y`.

The constraints are based on the available resources:
1. Watering time: Each car takes 30 minutes, and each bus takes 50 minutes. The total available time for watering is 5000 minutes. This gives us the constraint `30x + 50y <= 5000`.
2. Soap cost: Each car requires $10 worth of soap, and each bus requires $20 worth of soap. The total budget for soap is $1500. This translates to the constraint `10x + 20y <= 1500`.

Additionally, we have non-negativity constraints since the company cannot wash a negative number of cars or buses: `x >= 0` and `y >= 0`.

Now, let's translate this into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Car_and_Bus_Washing")

# Define the decision variables
x = m.addVar(lb=0, vtype=GRB.INTEGER, name="cars_washed")
y = m.addVar(lb=0, vtype=GRB.INTEGER, name="buses_washed")

# Define the objective function: Maximize earnings
m.setObjective(50*x + 75*y, GRB.MAXIMIZE)

# Add constraints
m.addConstr(30*x + 50*y <= 5000, name="watering_time")
m.addConstr(10*x + 20*y <= 1500, name="soap_budget")

# Optimize the model
m.optimize()

# Print the solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Cars washed: {x.x}")
    print(f"Buses washed: {y.x}")
    print(f"Maximum earnings: ${50*x.x + 75*y.x}")
else:
    print("No optimal solution found")
```