how close is close enough
An answer is partly a matter of what you are hoping to accomplish with your companions.
Marigolds are supposed to benefit the plants damaged by soil nematodes. Therefore, it is likely to help carrots to have the marigold roots fairly close.
Lettuce and spinach are harvested early, don't have very deep roots, and are damaged by the hot sun. If broccoli is to benefit these leaf veggies, it should be where the shadow of the plants protect them especially during the afternoon.
You may want to increase the garden's bee population by growing plants with lots of nectar. Probably, those plants don't really need to be anywhere near the vegetables that will benefit from more bees. The bees will be able to stop off on their way to and from the fennel or those perennial mint family plants blooming like crazy thru the Summer.
If you are growing beans and peas for their value in building nitrogen in the soil, you are probably going to need to wait until those plants have died and roots begin to decompose. Their companions won't benefit much from their nitrogen building capabilities immediately. Personally, I think that their real value isn't realized until the following season but they make a "happy" mix over the years in the garden.
Steve