You trim the layer when it's already IN the composition.
If you open footage in the footage window set an in and out points and then drag that footage into the new comp icon or select File>New comp from selection, you will get a comp trimmed to the length of your video. It worked that way for a very long time. If this procedure does not work for you then tell us what version of AE you are using.
What Rick describes has worked for the past several versions, but in older versions you had to do what Dave is suggesting. So, what version are you using?